home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu332 / c32src.arc / CHIPSEL.SA < prev    next >
Text File  |  1991-03-01  |  23KB  |  462 lines

  1.         TTL       M68300 BUSINESS CARD COMPUTER CHIP SELECT INIT
  2.         OPT       P=68332             SETUP FOR 68332 CODE
  3.         OPT       BRS                 SHORT BRANCHES PREFERED
  4.  
  5. ******************************************************************************
  6. *** EXPORTED PORTION OF THE MODULE HEADER                                  ***
  7. *V****************************************************************************
  8. ******************************************************************************
  9. ***                                                                        ***
  10. *** MODULE :       CHIP SELECT INITIALIZATION                              ***
  11. ***                                                                        ***
  12. *** ENVIRONMENT :  68300 Business Card Computer (BCC) Rev. A, B            ***
  13. ***                For M68300PFB Platform Board, Rev. A, B, C              ***
  14. ***                                                                        ***
  15. ***                NOTE:  BCC Rev. A + PFB Rev. A = Old System             ***
  16. ***                       BCC Rev. B + PFB Rev. B = New System             ***
  17. ***                                                                        ***
  18. ***                       PFB Rev. C is jumper selectable to be function-  ***
  19. ***                       ally equivalent to Rev. A or to Rev. B.          ***
  20. ***                                                                        ***
  21. ***                 ---- DO NOT MIX REV. A's WITH REV. B's! ----           ***
  22. ***                 ---- NO STACK USAGE (SUBR'S) ALLOWED!   ----           ***
  23. ***                                                                        ***
  24. *** LANGUAGE :     68332 ASSEMBLY LANGUAGE                                 ***
  25. ***                                                                        ***
  26. *** SUMMARY OF CONTENTS :                                                  ***
  27. ***     Determines BCC type (A or B) and initializes the appropriate chip  ***
  28. ***     selects using the corresponding values from the parameter area.    ***
  29. ***                                                                        ***
  30. *** LINK REQUIREMENTS :                                                    ***
  31. ***   NOTES:                                                               ***
  32. ***     1.  Source equivalent copy of CPU32Bug parameter area for Motorola ***
  33. ***         FREEWARE Bulletin Board System (BBS) to produce object         ***
  34. ***         equivalent code.  See REVISION HISTORY below for version nbr.  ***
  35. ***     2.  This source code can be freely used at no cost/obligation,     ***
  36. ***         i.e. it is PUBLIC DOMAIN software.  Please report any errors/  ***
  37. ***         additions to the SYSOP of the Motorola FREEWARE BBS.           ***
  38. ***     3.  Parameters which reference linker symbols (XREF/XDEF) will     ***
  39. ***         not be defined until link time, so the obj. code listed here   ***
  40. ***         will not match the actual EPROM code.                          ***
  41. ***                                                                        ***
  42. ******************************************************************************
  43. *^****************************************************************************
  44. *
  45.          PAGE
  46. *
  47. ******************************************************************************
  48. *** INTERNAL PORTION OF THE MODULE HEADER                                  ***
  49. ******************************************************************************
  50. ***                                                                        ***
  51. ***   REVISION HISTORY (add changes to the top):                           ***
  52. ***                                                                        ***
  53. ***      DATE         AUTHOR               CHANGES                         ***
  54. ***   ----------  ---------------  -------------------------------------   ***
  55. ***    03/01/91   Peter S. Gilmour Compatible with CPU32Bug version 1.00.  ***
  56. ***    05/02/90   Peter S. Gilmour Compatible with 332Bug version 1.02.    ***
  57. ***    01/17/90   Peter S. Gilmour Initial version port to MS_DOS based    ***
  58. ***                                M68MASM from original source code.      ***
  59. ***                                Compatible with 332Bug version 1.01.    ***
  60. ******************************************************************************
  61. *** XDEFS :                                                                ***
  62.         XDEF    INIT_CS
  63. ***                                                                        ***
  64. *** XREFS :                                                                ***
  65.         XREF    PWR_TBL2
  66.         XREF    .CSBAR0,.CSBAR1,.CSBAR2,.CSBARBT
  67.         XREF    CSBAR0$
  68.         XREF    MCR_OR,MCR_AND
  69.         XREF    SYPCR_OR,SYPCR_AND
  70. ***                                                                        ***
  71. ***   Local macros:                                                        ***
  72. ***                                                                        ***
  73. SYSTEM   MACRO                         ! SETUP MONITOR SPACE
  74. SECTD    SET       1                   ! DEFINE DATA SECTION
  75. SECTP    SET       14                  ! DEFINE PROGRAM SECTION
  76.          SECTION   SECTP               ! PUT USER INTO PROG. SECTION
  77.          ENDM                          !
  78. *
  79. * Time delay macro
  80. *   - allows bus capacitance to dissipate
  81. *   - at least 3 words must be fetched to guarantee dissipation
  82. *
  83. T_DELAY MACRO
  84.         NOP
  85.         NOP
  86.         NOP
  87.         ENDM
  88.  
  89. ***
  90. ***   Local equates:
  91. ***
  92. OLD_BCC  EQU       0                   Code ID for old BCC
  93. NEW_BCC  EQU       1                   Code ID for new BCC
  94.  
  95. *
  96. *  For M68300 BCC and PFB.
  97. *
  98. *  NOTE: Unused upper address lines are specified as 1's so ABSOLUTE SHORT
  99. *        addressing (sign extension) can be used.
  100. *
  101. SR_VAL    EQU      $2700               Status register initial value.
  102.  
  103. RAM_BASE  EQU      $0                  BCC RAM base address
  104. RAM_SIZE  EQU      $10000              BCC RAM size (bytes)
  105. ROM1_BASE EQU      $E0000              BCC EPROM base address
  106. ROM1_SIZE EQU      $20000              BCC EPROM size (bytes)
  107. IRAM_BASE EQU      $40000
  108. FPCP_BASE EQU      $FFFFE800           PFB MC68881/MC6882 base address
  109. *                                      .  (Floating Point Co-Processor)
  110. FCRYSTVAL EQU      32768               Crystal frequency (in Hz)
  111. HI_BASE   EQU      $FFFFF000           CPU32 module (registers) base high addr
  112. *                                      .  This is the default used at power-up!
  113. LO_BASE   EQU      $007FF000           CPU32 module (registers) base low  addr
  114. SIM       EQU      $A00                CPU32 System Integration Module base addr
  115. RAMCR     EQU      $B00                CPU32 RAM Control Module base offset
  116. QSM       EQU      $C00                CPU32 Queued Serial Module base offset
  117. AUTO_BASE EQU      $FFFFF800           Autovector base address
  118.  
  119. * Define bits for Power Up Status (PWRSTATUS) flag:
  120. EXTAL_BIT  EQU     31                  External Clock flag bit:    0= off (VCO)
  121. CHKSUM_BIT EQU     30                  Checksum not pgm'd yet bit: 0= pgm'd
  122.  
  123. LOCALRAM  EQU      RAM_BASE            base of local RAM
  124. SYSRAMSZ  EQU      $00004000           size of local RAM (for system use)
  125. LCLRAMMX  EQU      RAM_SIZE            max size of local RAM (for M68332 BCC)
  126. USRRAM    EQU      LOCALRAM+SYSRAMSZ   base of user RAM
  127. USRRAMSZ  EQU      LCLRAMMX-SYSRAMSZ   size of user RAM
  128. RAMSTART  EQU      LOCALRAM            alias for base of local RAM
  129.  
  130. LOCALROM  EQU      ROM1_BASE           base of local ROM (use PC rel refs!)
  131. LCLROMSZ  EQU      $00010000           size of local ROM used by 332Bug
  132. ROMUNPGM  EQU      $FF                 unprogrammed state of a byte of EPROM
  133. FILL.1    EQU      ROMUNPGM            fill value for 1 byte = BYTE
  134. FILL.2    EQU      FILL.1<<8+FILL.1    fill value for 2 bytes= WORD
  135. FILL.4    EQU      FILL.2<<16+FILL.2   fill value for 4 bytes= LONG WORD
  136.  
  137. RAM2_BASE EQU      LOCALRAM+LCLRAMMX   Next RAM base address
  138. ROM2_BASE EQU      ROM1_BASE+ROM1_SIZE Next ROM base address
  139.  
  140. VECTSIZ  EQU       $400                Vector table size
  141. USERLEN  EQU       $1000               user space reserved
  142. MEMINC   EQU       $4000               memory increment for 130's or EVM's
  143. STKLEN   EQU       MEMINC-USERLEN-VECTSIZ-4 size of bug/diag stack + static vars
  144.  
  145. *
  146. * Interrupt levels & vectors
  147. *
  148. ABORTLVL EQU       7                   abort level
  149. ABORTVEC EQU       31                  abort vector
  150. ACFAILVL EQU       7                   AC-Fail level
  151. ACFAILVC EQU       65                  AC-Fail vector
  152. TIMERLVL EQU       6                   timer level: M68332 periodic int. timer
  153. TIMERVEC EQU       66                  timer vector
  154.  
  155. *
  156. *  Setup Base Addresses:
  157. *    1. A31-A24 must= 0  (MC68332 only uses A0-A23; rest are unused!)
  158. *    2. A10-A0  must= 0  (for Base Address Register usage).
  159. *
  160. ADDRMASK EQU       $00FFF800           Address mask (24-bits, A10-A0= 0)
  161. RAM      EQU       RAM_BASE&ADDRMASK   Setup Base Addresses
  162. ROM      EQU       ROM1_BASE&ADDRMASK  Setup Base Addresses
  163. RAM2     EQU       RAM2_BASE&ADDRMASK  Setup Base Addresses
  164. ROM2     EQU       ROM2_BASE&ADDRMASK  Setup Base Addresses
  165. FPCP     EQU       FPCP_BASE&ADDRMASK  Setup Base Addresses
  166. IRAM     EQU       IRAM_BASE&ADDRMASK  Setup Base Addresses
  167. AVEC_7   EQU       AUTO_BASE&ADDRMASK  Setup Base Addresses
  168.  
  169. CSBAR_XX EQU       $0000               Reset (unused) value for CSBARn
  170. CSOR_XX  EQU       $0000               Reset (unused) value for CSORn
  171.  
  172. MCR      EQU       SIM+$00             Module Control Register
  173. MM_BIT   EQU       6                   .  MM bit number                 in MCR
  174. SYNCR    EQU       SIM+$04             Clock Synthesizer Control Register
  175. VCO_X    EQU       $4000               VCO Frequency Control Bit X value
  176. SYPCR    EQU       SIM+$20             System Protection Control Register
  177. SWE_BIT  EQU       7                   .  SWE bit number                in SYPCR
  178. SWP_BIT  EQU       6                   .  SWP bit number                in SYPCR
  179. SWE      EQU       1<<7                .  Software Watchdog Enable      in SYPCR
  180. SWP      EQU       1<<6                .  Software Watchdog Prescale    in SYPCR
  181. HME      EQU       1<<3                .  Halt Monitor Enable           in SYPCR
  182. BME      EQU       1<<2                .  Bus  Monitor Enable           in SYPCR
  183. BMT8     EQU       %11<<0              .  Bus  Monitor Timing  8 cycles in SYPCR
  184. BMT16    EQU       %10<<0              .  Bus  Monitor Timing 16 cycles in SYPCR
  185. BMT32    EQU       %01<<0              .  Bus  Monitor Timing 32 cycles in SYPCR
  186. BMT64    EQU       %00<<0              .  Bus  Monitor Timing 64 cycles in SYPCR
  187. SWSR     EQU       SIM+$27             Software Service Reg (WATCHDOG) = BYTE
  188. WATCHV1  EQU       $55                 .  Software Watchdog value #1
  189. WATCHV2  EQU       $AA                 .  Software Watchdog value #2
  190. CSPAR    EQU       SIM+$44             Chip Select Pin Assignment Register
  191. CSBARBT  EQU       SIM+$48             Chip Select Base Boot Register
  192. CSORBT   EQU       SIM+$4A             Chip Select Option Boot Register
  193. CSBAR0   EQU       SIM+$4C             Chip Select 0 Base Register
  194. CSOR0    EQU       SIM+$4E             Chip Select 0 Option Register
  195. CSBAR1   EQU       SIM+$50             Chip Select 1 Base Register
  196. CSOR1    EQU       SIM+$52             Chip Select 1 Option Register
  197. CSBAR2   EQU       SIM+$54             Chip Select 2 Base Register
  198. CSOR2    EQU       SIM+$56             Chip Select 2 Option Register
  199.  
  200. *
  201. * Option Register Equates (CSORBT, CSORn):
  202. *
  203. B2K      EQU       0                   2K    block size
  204. B8K      EQU       1                   8K    block size
  205. B16K     EQU       2                   16K   block size
  206. B64K     EQU       3                   64K   block size
  207. B128K    EQU       4                   128K  block size
  208. B256K    EQU       5                   256K  block size
  209. B512K    EQU       6                   512K  block size
  210. B1M      EQU       7                   1MB   block size
  211. ASYNC    EQU       $0000               Asynchronous mode
  212. SYNC     EQU       $8000               Synchronous  mode
  213. CS_UPPB  EQU       2*$2000             Upper byte
  214. CS_LOWB  EQU       1*$2000             Lower byte
  215. CS_BOTHB EQU       3*$2000             Both  bytes (upper or lower)
  216. CS_R     EQU       1*$800              Read
  217. CS_W     EQU       2*$800              Write
  218. CS_RW    EQU       3*$800              Read or write
  219. CS_AS    EQU       0*$400              Address Strobe (AS*)
  220. CS_DS    EQU       1*$400              Data    Strobe (DS*)
  221. CS_FAST  EQU       14                  Fast     termination DSACK*
  222. CS_EXT   EQU       15                  External termination DSACK*
  223. CS_WAIT  EQU       1*$40               Wait cycles for DSACK*
  224. CS_CSP   EQU       0*$10               CPU  space
  225. CS_USP   EQU       1*$10               User space
  226. CS_SSP   EQU       2*$10               Supervisor space
  227. CS_SUSP  EQU       3*$10               Supervisor/User space
  228. CS_LVL   EQU       1*$2                Interrupt priority level
  229. CS_AVEC  EQU       1                   Autovector enable
  230.  
  231.  
  232. ******************************************************************************
  233. *
  234.         SYSTEM
  235.  
  236. * Start Chip Select Initialization:
  237. *
  238. INIT_CS:
  239.         MOVE.W    #SR_VAL,SR           Ensure status register initialized.
  240.         LEA       HI_BASE,A5           Assume registers are at high memory.
  241.  
  242. * Set up CSBOOT CHIP SELECT:
  243. *  - Long word also gets .CSORBT value into CSORBT register!
  244. *  - Must set up wait cycles for Boot ROM before we change Bus Monitor
  245. *    timeout value in SYPCR (allows booting in 8-bit mode!).
  246. *  - SR and CSBOOT/CSORBT initialized by INIT_T1 routine.  See
  247. *    INITTBL.SA and RESETV.SA files for details.  We repeat the init-
  248. *    ialization here in case the user has by-passed/disabled calling
  249. *    the INIT_T1 routine via the PWR_TBL1 Power On Branch vector.
  250. *
  251.         MOVE.L    ((.CSBARBT).L,PC),CSBARBT(A5)
  252.  
  253. * Set up SYSTEM PROTECTION REGISTER (SYPCR) per paramter area values:
  254. *   - controls such things as Software Watchdog, Halt Monitor, Bus Monitor, etc.
  255. *   - SYPCR is a write-once register!
  256.         MOVE.B    SYPCR(A5),D0
  257.         MOVEQ.L   #0,D7                Clear all flag bits.
  258.         BTST      #SWP_BIT,D0          Test SWP bit = MODCK* at Power Up
  259.    IF  <NE>  THEN.S                    If bit set, then
  260.         BSET      #EXTAL_BIT,D7        .  Set External Clock flag bit on.
  261.    ENDI
  262.         OR.B      ((SYPCR_OR).L,PC),D0
  263.         AND.B     ((SYPCR_AND).L,PC),D0
  264.         MOVE.B    D0,SYPCR(A5)
  265. * From now on, the Software Watchdog could be running!  The SWE_BIT in SYPCR_AND
  266. * controls the Software Watchdog as follows:
  267. *          0 = Watchdog is disabled
  268. *          1 = Watchdog is enabled
  269. * The SWE_BIT in the real SYPCR register can also be tested, but is usually a
  270. * bit more difficult because the module register block is movable!
  271.  
  272. * Now let's go to 16.7 MHZ:
  273. *
  274.         OR.W      #VCO_X,SYNCR(A5)     X-bit doubles the current speed!
  275.  
  276. * Set up Module Configuration Register (MCR) per paramter area values:
  277. *   - controls such things as FRZBM, MM, IARB, etc.
  278.         MOVE.W    MCR(A5),D0
  279.         OR.W      ((MCR_OR).L,PC),D0
  280.         AND.W     ((MCR_AND).L,PC),D0
  281.         MOVE.W    D0,MCR(A5)
  282. * From now on, the registers could have been relocated to low memory!
  283.  
  284.         BTST      #MM_BIT,D0
  285.    IF  <EQ>  THEN.S                    If MM bit = 0, then
  286.         LEA       LO_BASE,A5           .  registers are at low memory!
  287.    ENDI
  288. * [A5] = register module base address!
  289.  
  290. * Service the Software Watchdog (just in case it's running!):
  291.         MOVE.B    #WATCHV1,SWSR(A5)
  292.         MOVE.B    #WATCHV2,SWSR(A5)
  293.  
  294. *
  295. * Set up all Chip Selects as "chip selects" in case user's have connected h/w
  296. * devices.  Otherwise, address lines would be toggling as program runs and
  297. * possibly cause the devices to be enabled!
  298.         MOVE.L    #$FFFFFFFF,CSPAR(A5)  All = chip selects, 16-bit port
  299. *                                       .  (unused bits have no effect!)
  300.  
  301. * Set up RAM and CSBOOT CHIP SELECTs to old BCC values:
  302. *
  303.         MOVE.L    ((.CSBAR0).L,PC),CSBAR0(A5)
  304.         MOVE.L    ((.CSBAR1).L,PC),CSBAR1(A5)
  305.  
  306. * Test for old BBC by enabling its onboard RAM and ROM.
  307. * If RAM found, then
  308. *   assume old BCC with old Platform Board
  309. * else
  310. *   assume new BCC with new Platform Board
  311. * endif
  312. * If board == old_BCC
  313. *   initialize chip selects for old BCC and old platform board
  314. * else
  315. *   initialize chip selects for new BCC and new platform board
  316. * endif
  317. *
  318. * To find RAM:
  319. *   ($0000) = $5AA5A55A
  320. *   delay to allow bus capacitance to dissipate
  321. *   if ($0000) == $5AA5A55A then
  322. *     ($0000) = $A55A5AA5
  323. *     delay to allow bus capacitance to dissipate
  324. *     if ($0000) == $A55A5AA5 then
  325. *       RAM found
  326. *     endif
  327. *   else
  328. *      ($2F00) = $5AA5A55A
  329. *      delay to allow bus capacitance to dissipate
  330. *      if ($2F00) == $5AA5A55A then
  331. *        ($2F00) = $A55A5AA5
  332. *        delay to allow bus capacitance to dissipate
  333. *        if ($2F00) == $A55A5AA5 then
  334. *          RAM found
  335. *        endif
  336. *     endif
  337. *  endif
  338. *
  339.  
  340. * NOTE:  By default at Power Up, CSBOOT responds to any address in the
  341. *        range of $0-$FFFFF (block size= 1 MB) to select the Boot ROM.
  342. *        Since the Boot ROM only uses address lines A0-A16 (128K), it
  343. *        appears replicated thru the memory map at every even ROM size
  344. *        ($20000) boundary as follows:
  345. *           $00000, $20000, $40000, $60000, $80000, $A0000, $C0000, $E0000
  346. *        Thus the power up reset vectors for the SP and PC are fetched from
  347. *        locations $0-7 and the PC is set to the memory range where we will
  348. *        be programming the Boot ROM to appear at via the chip selects.
  349. *        When the programming occurs, there are no addressing "glitches"
  350. *        because we stay at the same locations!
  351.  
  352.         MOVEQ.L   #NEW_BCC,D0
  353.         MOVE.L    #$5AA5A55A,D1        NOTE:  D1 and D2 are inverse patterns!
  354.         MOVE.L    #$A55A5AA5,D2
  355.         SUB.L     A0,A0                Test loca. = $0000.
  356.  
  357.         MOVE.L    D1,(A0)
  358.         T_DELAY
  359.    IF.L  D1 <EQ> (A0)  THEN.S          If test loca. is good, then
  360.         MOVE.L    D2,(A0)
  361.         T_DELAY
  362.       IF.L  D2 <EQ> (A0)  THEN.S       .  If inverse is good, then
  363.         MOVEQ.L   #OLD_BCC,D0          .    Got RAM, so must be old BCC!
  364.       ENDI
  365.    ELSE.S                              else maybe just 1 bad loca.
  366.         MOVE.W    #$2F00,A0            .  Test loca. = $2F00.
  367. *------------------------------------------------------------------------------
  368. * CAUTION:  In the above "MOVE.W #$XXXX,A0" do not use an address with the
  369. *           sign bit set, e.g., $8000, because sign extension will cause a
  370. *           BUS ERROR below and crash the system!  Also, the address must
  371. *           not be in the user ram area ($3000-FFFF), or we could corrupt
  372. *           the user's ram!  Thus we use $2F00, which is inside CPU32Bug's
  373. *           internal stack area.
  374. *------------------------------------------------------------------------------
  375.         MOVE.L    D1,(A0)
  376.         T_DELAY
  377.       IF.L  D1 <EQ> (A0)  THEN.S       .  If test loca. is good, then
  378.         MOVE.L    D2,(A0)
  379.         T_DELAY
  380.          IF.L  D2 <EQ> (A0)  THEN.S    .    If inverse is good, then
  381.             MOVEQ.L   #OLD_BCC,D0      .      Got RAM, so must be old BCC.
  382.          ENDI
  383.       ENDI
  384.    ENDI
  385.  
  386. * Service the Software Watchdog (just in case it's running!):
  387.         MOVE.B    #WATCHV1,SWSR(A5)
  388.         MOVE.B    #WATCHV2,SWSR(A5)
  389.  
  390.         CMP.B     #OLD_BCC,D0
  391.         BNE.S     BCC_NEW                 Branch if old BCC not found!
  392.  
  393. * Here for old BCC and old Platform board (see Rev. 1 schematics for each):
  394. *
  395. *  U1/U3 = 120 nsec RAM w/fast termination
  396. *  U2/U4 = ROM, but laid out wrong, so can only be used as 120 nsec RAM!
  397. *
  398. *   CSBOOT = BCC U4       332Bug EPROM
  399. *   CS0    = BCC U3       read/write enable for MSB=UPPER=EVEN ram
  400. *   CS1    = BCC U2       read/write enable for LSB=LOWER=ODD  ram
  401. *   CS2    = PFB U1/U3    read       enable for MSB/LSB=BOTH   rams
  402. *   CS3    = PFB U1       write      enable for LSB=LOWER=ODD  ram
  403. *   CS4    = PFB U4       read       enable for MSB=UPPER=EVEN ram/eprom
  404. *   CS5    = PFB U2       read       enable for LSB=LOWER=ODD  ram/eprom
  405. *   CS6    = PFB U5       chip       enable for MC68881/882
  406. *   CS7    = <unused>
  407. *   CS8    = PFB          ABORT pushbutton autovector
  408. *   CS9    = <unused>
  409. *   CS10   = PFB U3       write enable for MSB=UPPER=EVEN ram
  410. *                         . cut/jump U3-27 from CS4 to CS10 required!
  411. *
  412. * Set up other CHIP SELECT ports (CS0,CS1,CSBOOT already done):
  413. *
  414. BCC_OLD LEA       ((.CSBAR2).L,PC),A0  Point to old CS2 entry.
  415.         LEA       CSBAR2(A5),A1        Point to corresponding SIM reg.
  416.         MOVEQ.L   #(10-2+1)-1,D0       Set count to do CS2-CS10.
  417. *                                      .  ("-1" for DBRA loop below!)
  418.         BRA.S     CS_COM               Go to common init routine!
  419.  
  420.  
  421. * Here for new BCC and new Platform board (see Rev. 2 schematics for each):
  422. *
  423. *  U1/U3 = 120 nsec RAM w/fast termination
  424. *  U2/U4 = 250 nsec ROM (or jumper selectable as RAM)
  425. *
  426. *   CSBOOT = BCC U4       CPU32Bug EPROM
  427. *   CS0    = BCC U3       write enable for MSB=UPPER=EVEN ram
  428. *   CS1    = BCC U2       write enable for LSB=LOWER=ODD  ram
  429. *   CS2    = BCC U3/U2    read  enable for MSB/LSB=BOTH   rams
  430. *   CS3    = <unused>
  431. *   CS4    = PFB          ABORT pushbutton autovector
  432. *   CS5    = PFB U5       chip  enable for MC68881/882
  433. *                         . cut/jump U5-J3 from CS2 to CS5 required!
  434. *   CS6    = PFB U2       read  enable for LSB=LOWER=ODD  ram/eprom
  435. *   CS7    = PFB U4       read  enable for MSB=UPPER=EVEN ram/eprom
  436. *   CS8    = PFB U1/U3    read  enable for MSB/LSB=BOTH   rams
  437. *   CS9    = PFB U1       write enable for LSB=LOWER=ODD  ram
  438. *   CS10   = PFB U3       write enable for MSB=UPPER=EVEN ram
  439. *
  440. * Set up all CHIP SELECT ports (CSBOOT already done):
  441. *
  442. BCC_NEW LEA       ((CSBAR0$).L,PC),A0  Point to new CS0 entry.
  443.         LEA       CSBAR0(A5),A1        Point to corresponding SIM reg.
  444.         MOVEQ.L   #(10-0+1)-1,D0       Set count to do CS0-CS10.
  445. *                                      .  ("-1" for DBRA loop below!)
  446.  
  447. * Common CHIP SELECTS initialization routine:
  448. *   A0.L = chip select configuration table entry (base addr)
  449. *   A1.L = corresponding SIM register
  450. *   D0.W = number of chip selects -1 to be initialized
  451. *
  452. CS_COM  MOVE.L    (A0)+,(A1)+          Init. SIM base addr + option register.
  453.         DBRA      D0,CS_COM            Continue until all regs init'ed.
  454.  
  455. * Service the Software Watchdog (just in case it's running!):
  456.         MOVE.B    #WATCHV1,SWSR(A5)
  457.         MOVE.B    #WATCHV2,SWSR(A5)
  458.  
  459. * [D7.L] = Power Up Status Flag
  460.         BRA.L     PWR_TBL2             Return to Power On Branch Vector
  461.         END
  462.